/*
* Entourage
* Copyright 2011 INF532@Galatasaray University & Vincent Labatut 
* 
* This file is part of Entourage.
* 
* Entourage is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* 
* Entourage is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* 
* You should have received a copy of the GNU General Public License
* along with Entourage. If not, see <http://www.gnu.org/licenses/>.
* 
*/

package com.appspot.entourage.graphtools;


/**
 * This class is used to represent relation between 2 nodes
 * @author Berk PELENK <bpelenk@beengames.com>
 * @version 1
 * @see GraphNode
 *
 */
public class GraphEdge {
	private GraphNode node1;
	private GraphNode node2;
	private int connections;
	
	/**
	 * This is the constructor method
	 * @param node1 Node 1
	 * @param node2 Node 2
	 * @param connections Number of connections between 2 nodes
	 * @author Berk PELENK <bpelenk@beengames.com>
	 * @see GraphNode
	 */
	public GraphEdge(GraphNode node1, GraphNode node2, int connections)
	{
		this.node1 = node1;
		this.node2 = node2;
		this.connections = connections;
	}
	
	/**
	 * This method returns the first node in the relation
	 * @return Node 1
	 * @author Berk PELENK <bpelenk@beengames.com>
	 * @see GraphNode
	 */
	public GraphNode getNode1()
	{
		return node1;
	}
	
	/**
	 * This method returns the second node in the relation
	 * @return Node 2
	 * @author Berk PELENK <bpelenk@beengames.com>
	 * @see GraphNode
	 */
	public GraphNode getNode2()
	{
		return node2;
	}
	
	/**
	 * This method returns the number of connections between 2 nodes
	 * @return number of connections
	 * @author Berk PELENK <bpelenk@beengames.com>
	 * @see GraphNode
	 */	
	public int getConnections()
	{
		return connections;
	}
}
